package org.example.booksmanagementsystem.model;

import org.example.booksmanagementsystem.enums.ResultStatus;

public class Result {
    private ResultStatus status;

    private String ErrorMessage;

    private Object data;


    public static Result success(Object data){
        Result result  = new Result();
        result.setStatus(ResultStatus.SUCCESS);

        // 赋值返回的数据
        result.data = data;

        return result;
    }


    public ResultStatus getStatus() {
        return status;
    }

    public void setStatus(ResultStatus status) {
        this.status = status;
    }

    public String getErrorMessage() {
        return ErrorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        ErrorMessage = errorMessage;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
